namespace DaoHang.Models
{
    /// <summary>
    /// 数据导出模型
    /// </summary>
    public class DataExportModel
    {
        /// <summary>
        /// 导出时间
        /// </summary>
        public DateTime ExportTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 导出版本
        /// </summary>
        public string Version { get; set; } = "1.0";

        /// <summary>
        /// 网站数据
        /// </summary>
        public List<WebsiteExportData> Websites { get; set; } = new();

        /// <summary>
        /// 分类数据
        /// </summary>
        public List<CategoryExportData> Categories { get; set; } = new();

        /// <summary>
        /// 站点设置数据
        /// </summary>
        public SiteSettingsExportData? SiteSettings { get; set; }

        /// <summary>
        /// AI配置数据
        /// </summary>
        public List<AIConfigExportData> AIConfigs { get; set; } = new();

        /// <summary>
        /// 系统日志数据
        /// </summary>
        public List<SystemLogExportData> SystemLogs { get; set; } = new();

        /// <summary>
        /// 管理员用户数据
        /// </summary>
        public List<UserExportData> Users { get; set; } = new();
    }

    /// <summary>
    /// 网站导出数据
    /// </summary>
    public class WebsiteExportData
    {
        /// <summary>
        /// 网站名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 网站URL
        /// </summary>
        public string Url { get; set; } = string.Empty;

        /// <summary>
        /// 网站描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 网站图标URL
        /// </summary>
        public string IconUrl { get; set; } = string.Empty;

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CategoryName { get; set; } = string.Empty;

        /// <summary>
        /// 排序顺序
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
    }

    /// <summary>
    /// 分类导出数据
    /// </summary>
    public class CategoryExportData
    {
        /// <summary>
        /// 分类名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 分类描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 分类图标
        /// </summary>
        public string Icon { get; set; } = string.Empty;

        /// <summary>
        /// 排序顺序
        /// </summary>
        public int SortOrder { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
    }

    /// <summary>
    /// 站点设置导出数据
    /// </summary>
    public class SiteSettingsExportData
    {
        /// <summary>
        /// 网站标题
        /// </summary>
        public string SiteTitle { get; set; } = string.Empty;

        /// <summary>
        /// 网站描述
        /// </summary>
        public string SiteDescription { get; set; } = string.Empty;

        /// <summary>
        /// 网站关键词
        /// </summary>
        public string SiteKeywords { get; set; } = string.Empty;

        /// <summary>
        /// 网站Logo URL
        /// </summary>
        public string LogoUrl { get; set; } = string.Empty;

        /// <summary>
        /// 备案信息
        /// </summary>
        public string IcpInfo { get; set; } = string.Empty;

        /// <summary>
        /// 版权信息
        /// </summary>
        public string Copyright { get; set; } = string.Empty;

        /// <summary>
        /// 联系邮箱
        /// </summary>
        public string ContactEmail { get; set; } = string.Empty;
    }

    /// <summary>
    /// AI配置导出数据
    /// </summary>
    public class AIConfigExportData
    {
        /// <summary>
        /// 配置名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 提供商
        /// </summary>
        public string Provider { get; set; } = string.Empty;

        /// <summary>
        /// API地址
        /// </summary>
        public string ApiUrl { get; set; } = string.Empty;

        /// <summary>
        /// 模型名称
        /// </summary>
        public string ModelName { get; set; } = string.Empty;

        /// <summary>
        /// 超时时间（秒）
        /// </summary>
        public int TimeoutSeconds { get; set; } = 30;

        /// <summary>
        /// 温度参数
        /// </summary>
        public double Temperature { get; set; } = 0.7;

        /// <summary>
        /// 最大令牌数
        /// </summary>
        public int MaxTokens { get; set; } = 1000;

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 是否为活跃配置
        /// </summary>
        public bool IsActive { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
    }

    /// <summary>
    /// 系统日志导出数据
    /// </summary>
    public class SystemLogExportData
    {
        /// <summary>
        /// 日志级别
        /// </summary>
        public string Level { get; set; } = string.Empty;

        /// <summary>
        /// 日志分类
        /// </summary>
        public string Category { get; set; } = string.Empty;

        /// <summary>
        /// 日志消息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 异常信息
        /// </summary>
        public string? Exception { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        public string? UserId { get; set; }

        /// <summary>
        /// IP地址
        /// </summary>
        public string? IpAddress { get; set; }

        /// <summary>
        /// 用户代理
        /// </summary>
        public string? UserAgent { get; set; }

        /// <summary>
        /// 请求路径
        /// </summary>
        public string? RequestPath { get; set; }

        /// <summary>
        /// 附加数据
        /// </summary>
        public string? AdditionalData { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }

    /// <summary>
    /// 用户导出数据
    /// </summary>
    public class UserExportData
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 密码哈希值
        /// </summary>
        public string PasswordHash { get; set; } = string.Empty;

        /// <summary>
        /// 邮箱地址
        /// </summary>
        public string? Email { get; set; }

        /// <summary>
        /// 是否为超级管理员
        /// </summary>
        public bool IsAdmin { get; set; } = true;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }
} 